$(function() {
	$(".menu").click(function() {
		$(".nav").toggle()
		$(this).toggleClass("close")
	});

	var windowWidth = window.screen.width
	console.log(windowWidth)
	if (windowWidth <= 990) {
		$(".nav ul li a.aa").attr("href", "javascript:;")
		$(".erji a").click(function() {
			$(".nav").toggle()
			$(".menu").toggleClass("close")
		})
		$(".nav li").click(function() {
			$(this).find(".erji").toggle()
		})
	} else {
		$(".nav li").mouseover(function() {
			$(this).find(".erji").show()
		})
		$(".nav li").mouseout(function() {
			$(this).find(".erji").hide()
		})
	};

	var swiper = new Swiper(".banner .mySwiper", {
		spaceBetween: 0,
		centeredSlides: true,
	});

	$(".head1_c_en .a1").click(function() {
		$(".head1_c_en ul").toggle()
	});
	$(".ke_click").click(function() {
		$(".index_form").show()
	});
	$(".index_form_hide").click(function() {
		$(".index_form").hide()
	});
	var width = $(window).width();
	if (width > 768) {
		var swiper = new Swiper(".index5 .mySwiper", {
			slidesPerView: 2,
			spaceBetween: 80,
			// freeMode: true,
			navigation: {
				nextEl: ".index5 .swiper-button-next",
				prevEl: ".index5 .swiper-button-prev",
			},
		});
	} else {
		var swiper = new Swiper(".index5 .mySwiper", {
			slidesPerView: 1,
			spaceBetween: 10,
			// freeMode: true,
			navigation: {
				nextEl: ".index5 .swiper-button-next",
				prevEl: ".index5 .swiper-button-prev",
			},
		});
	}

	var width = $(window).width();
	if (width > 768) {
		var swiper = new Swiper(".index7 .mySwiper", {
			slidesPerView: 4,
			spaceBetween: 0,
			// freeMode: true,
			navigation: {
				nextEl: ".index7 .swiper-button-next",
				prevEl: ".index7 .swiper-button-prev",
			},
		});
	} else {
		var swiper = new Swiper(".index7 .mySwiper", {
			slidesPerView: 2,
			spaceBetween: 0,
			// freeMode: true,
			navigation: {
				nextEl: ".index7 .swiper-button-next",
				prevEl: ".index7 .swiper-button-prev",
			},
		});
	}
	$(".foot_top").click(function() {
		$("html,body").animate({
			'scrollTop': '0px'
		}, 300)
	});
	$(".travel1_bff li").click(function() {
		$(this).find(".avel1_b_cc").toggle()
	})
	$(".retraining_l_jj li").click(function() {
		$(this).find(".avel1_b_cc").toggle()
	});
	$(".retraining_l_pp li").click(function() {
	  var $this = $(this);
	  if($this.hasClass("bg")){
	    $this.removeClass("bg").find('.retr_cc').slideToggle(); 
	  }else{
	    $this.addClass("bg").find('.retr_cc').slideToggle(); 
	    $this.siblings().removeClass("bg").find('.retr_cc').slideUp();
	  }
	});
	$(".ziyou1 li").click(function() {
	  var $this = $(this);
	  if($this.hasClass("bg")){
	    $this.removeClass("bg").find('.ziyou1_cont').slideToggle(); 
	  }else{
	    $this.addClass("bg").find('.ziyou1_cont').slideToggle(); 
	    $this.siblings().removeClass("bg").find('ziyou1_cont').slideUp();
	  }
	})
});
